package com.qihetimes.earthangel.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 会话表
 * </p>
 *
 * @author f4cklangzi@gmail.com
 * @since 2022-01-03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("conversation")
@ApiModel(value="Conversation对象", description="会话表")
public class Conversation implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId("id")
    private String id;

    @ApiModelProperty(value = "会话类型")
    @TableField("type")
    private String type;

    @ApiModelProperty(value = "和消息关联的ID")
    @TableField("relation_id")
    private String relationId;

    @ApiModelProperty(value = "对方用户ID")
    @TableField("from_user_id")
    private String fromUserId;

    @ApiModelProperty(value = "对方昵称")
    @TableField("from_user_nick_name")
    private String fromUserNickName;

    @ApiModelProperty(value = "对方头像")
    @TableField("from_user_avatar_url")
    private String fromUserAvatarUrl;

    @ApiModelProperty(value = "接收方用户ID")
    @TableField("to_user_id")
    private String toUserId;

    @ApiModelProperty(value = "接收方昵称")
    @TableField("to_user_nick_name")
    private String toUserNickName;

    @ApiModelProperty(value = "接收方头像")
    @TableField("to_user_avatar_url")
    private String toUserAvatarUrl;

    @ApiModelProperty(value = "未读消息数")
    @TableField("unread_count")
    private Integer unreadCount;

    @ApiModelProperty(value = "会话物品信息")
    @TableField("goods_info")
    private String goodsInfo;

    @ApiModelProperty(value = "会话创建时间")
    @TableField("created_at")
    private LocalDateTime createdAt;

    @ApiModelProperty(value = "会话更新时间")
    @TableField("updated_at")
    private LocalDateTime updatedAt;


}
